home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #301 (1994)(Rhein-Sieg-Soft).zip / Franz PD Disk #301 (1994)(Rhein-Sieg-Soft).adf / DoBB / DoBB.S / DoBB.S
Text File  |  1994-01-21  |  13KB  |  507 lines

  1.  
  2. * DoBB V1.10 installiert einen BootBlock auf Diskette
  3. * oder  schreibt  einen  BootBlock  in  eine  Datei !
  4.  
  5. * mDoBBm V1.10 (r) 29. Dez, 1993 von   Volker Stepprath
  6. *                                    Tegeler Str. 7
  7. *                                    40789 Monheim
  8. *                                    Deutschland
  9.  
  10. * Editor:    AZ Editor v1.50 (c) « Software Winery »
  11. * Assembler: GenAm Macro Assembler V2.11D (c) 85/8 HiSoft
  12.  
  13.  
  14.  
  15.  
  16.              * Variablen definieren *
  17.  
  18.  
  19. _SYSBase           equ        4
  20. _LVOOpen           equ      -30
  21. _LVOClose          equ      -36
  22. _LVORead           equ      -42
  23. _LVOWrite          equ      -48
  24. _LVOOutput         equ      -60
  25. _LVOAllocMem       equ     -198
  26. _LVOFreeMem        equ     -210
  27. _LVOFindTask       equ     -294
  28. _LVOOldOpenLibrary equ     -408
  29. _LVOCloseLibrary   equ     -414
  30. _LVOOpenDevice     equ     -444
  31. _LVOCloseDevice    equ     -450
  32. _LVODoIO           equ     -456
  33.  
  34.  
  35.  
  36.  
  37. _NULLBYTE    move.b  #0,-1(a0,d0.l)
  38.  
  39.  
  40.  
  41.  
  42.              * Parameter retten *
  43.  
  44.  
  45.              move.l  a0,d6
  46.              move.l  d0,d7
  47.  
  48.  
  49.  
  50.  
  51.              * Hauptprogramm *
  52.  
  53.  
  54. _MAIN        bsr     _OPENALL
  55.  
  56.              move.l  d6,a0
  57.              move.l  d7,d0
  58.  
  59.              cmp.l   #7,d0
  60.              ble     _FEHLER
  61.              cmp.b   #58,3(a0)
  62.              bne     _FEHLER
  63.              move.b  2(a0),d4
  64.              sub.b   #48,d4
  65.              cmp.b   #0,d4
  66.              blt     _FEHLER
  67.              cmp.b   #3,d4
  68.              bgt     _FEHLER
  69.  
  70.              bsr     _OPENDEV
  71.              cmp.l   #0,d0
  72.              bne     _DEVFEHLER
  73.  
  74.              bsr     _ALLOCMEM
  75.              bsr     _BOOTBLOCK
  76.              bsr     _FREEMEM
  77.              bsr     _CLOSEDEV
  78.              bra     _CLOSELIB
  79.  
  80.  
  81.  
  82.  
  83.              * dos.library öffnen & Akt. Fenster *
  84.  
  85.  
  86. _OPENALL     move.l  _SYSBase,a6
  87.              lea     Dosname(pc),a1
  88.              jsr     _LVOOldOpenLibrary(a6)
  89.              move.l  d0,_DOSBase
  90.  
  91.              move.l  _DOSBase(pc),a6
  92.              jsr     _LVOOutput(a6)
  93.              move.l  d0,Handle
  94.              rts
  95.  
  96.  
  97.  
  98.  
  99.              * trackdisk.device bereitsetellen *
  100.  
  101.  
  102. _OPENDEV     move.l  _SYSBase,a6
  103.              sub.l   a1,a1
  104.              jsr     _LVOFindTask(a6)
  105.              move.l  d0,DiskReply+$10
  106.              lea     DiskIO(pc),a1
  107.              move.l  #DiskReply,14(a1)
  108.              clr.l   d1
  109.              move.l  d4,d0
  110.              lea     Device(pc),a0
  111.              jsr     _LVOOpenDevice(a6)
  112.              rts
  113.  
  114.  
  115.  
  116.  
  117.              * Speicher reservieren *
  118.  
  119.  
  120. _ALLOCMEM    move.l  _SYSBase,a6
  121.              move.l  #1024,d0
  122.              move.l  #$10003,d1
  123.              jsr     _LVOAllocMem(a6)
  124.              move.l  d0,DiskBuff
  125.              rts
  126.  
  127.  
  128.  
  129.  
  130.              * Speicher freigeben *
  131.  
  132.  
  133. _FREEMEM     move.l  _SYSBase,a6
  134.              move.l  #1024,d0
  135.              move.l  DiskBuff(pc),a1
  136.              jsr     _LVOFreeMem(a6)
  137.              rts
  138.  
  139.  
  140.  
  141.  
  142.              * Parameter auswerten und ausführen *
  143.  
  144.  
  145. _BOOTBLOCK   move.l  d6,a0
  146.              add.b   #3,(a0)
  147.  
  148.              cmp.b   #45,5(a0)        * Korekter Parameter -
  149.              bne     _USAGE           * ÄhÄh !
  150.  
  151.              clr.l   d0
  152.              move.b  6(a0),d0
  153.              bclr    #5,d0            * in Großbuchstabe wandeln
  154.  
  155.              cmp.b   #82,d0           * Parameter R ?
  156.              beq     _BOOTODAT        * Jo!
  157.  
  158.              cmp.b   #87,d0           * Parameter W ?
  159.              beq     _DATOBOOT        * Jear!
  160.  
  161.              cmp.b   #78,d0           * Parameter N ?
  162.              beq     _NOBOOT          * Klaro!
  163.  
  164.              cmp.b   #68,d0           * Parameter D ?
  165.              beq     _DOSBOOT         * Nlogen!
  166.  
  167.              cmp.b   #70,d0           * Parameter F ?
  168.              beq     _FORMATBOOT      * Jeil!
  169.  
  170.              cmp.b   #79,d0           * Parameter O ?
  171.              beq     _OS3BOOT         * Escht!
  172.  
  173.              cmp.b   #81,d0           * Parameter Q ?
  174.              beq     _QUARTEXBOOT     * Issohr!
  175.  
  176.              bra     _USAGE           * Ungültige Parameter !
  177.  
  178.  
  179.  
  180.  
  181.              * BootBlock in Datei schreiben *
  182.  
  183.  
  184. _BOOTODAT    bsr     _READBOOT
  185.              bsr     _GETNAME
  186.  
  187.              move.l  _DOSBase(pc),a6
  188.              move.l  #1006,d2
  189.              jsr     _LVOOpen(a6)
  190.              move.l  d0,Handledat
  191.              cmp.l   #0,Handledat
  192.              beq     _FILEFEHLER
  193.              move.l  Handledat(pc),d1
  194.              move.l  DiskBuff(pc),d2
  195.              move.l  #1024,d3
  196.              jsr     _LVOWrite(a6)
  197.              move.l  Handledat(pc),d1
  198.              jsr     _LVOClose(a6)
  199.              rts
  200.  
  201.  
  202.  
  203.  
  204.  
  205.              * BootBlock formatieren & in Datei schreiben *
  206.  
  207.  
  208. _FORMATBOOT  bsr     _READBOOT
  209.              bsr     _GETNAME
  210.  
  211.              move.l  _DOSBase(pc),a6
  212.              move.l  #1006,d2
  213.              jsr     _LVOOpen(a6)
  214.              move.l  d0,Handledat
  215.              cmp.l   #0,Handledat
  216.              beq     _FILEFEHLER
  217.  
  218.              move.l  DiskBuff(pc),a1
  219.              move.l  #1024,d1
  220.              clr.l   d3
  221.              clr.l   d4
  222.  
  223. _FORMAT      addq    #1,d4
  224.              tst.b   (a1)+
  225.              beq     _LOOP
  226.              move.l  d4,d3
  227. _LOOP        dbra    d1,_FORMAT
  228.  
  229.              move.l  Handledat(pc),d1
  230.              move.l  DiskBuff(pc),d2
  231.              jsr     _LVOWrite(a6)
  232.              move.l  Handledat(pc),d1
  233.              jsr     _LVOClose(a6)
  234.              rts
  235.  
  236.  
  237.  
  238.  
  239.              * BootBlock einlesen *
  240.  
  241.  
  242. _READBOOT    move.l  _SYSBase,a6
  243.              lea     DiskIO(pc),a1
  244.              move.w  #2,28(a1)
  245.              move.l  DiskBuff(pc),40(a1)
  246.              move.l  #1024,36(a1)
  247.              move.l  #0,44(a1)
  248.              jsr     _LVODoIO(a6)
  249.              rts
  250.  
  251.  
  252.  
  253.  
  254.              * Datei in BootBlock installieren *
  255.  
  256.  
  257. _DATOBOOT    bsr     _GETNAME
  258.              move.l  _DOSBase(pc),a6
  259.              move.l  #1005,d2
  260.              jsr     _LVOOpen(a6)
  261.              move.l  d0,Handledat
  262.              cmp.l   #0,Handledat
  263.              beq     _FILEFEHLER
  264.  
  265.              move.l  Handledat(pc),d1
  266.              move.l  DiskBuff(pc),d2
  267.              move.l  #1024,d3
  268.              jsr     _LVORead(a6)
  269.  
  270.              move.l  Handledat(pc),d1
  271.              jsr     _LVOClose(a6)
  272.  
  273.              move.l  DiskBuff(pc),a4
  274.              move.l  #255,d0
  275.              bsr     _DOIO
  276.              rts
  277.  
  278.  
  279.  
  280.  
  281.              * Dateinamen ermitteln *
  282.  
  283.  
  284. _GETNAME     move.l  d6,a0
  285.              add.l   #7,a0
  286.              move.l  a0,d1
  287.              rts
  288.  
  289.  
  290.  
  291.  
  292.              * OS 3.0 Boot *
  293.  
  294. _OS3BOOT     lea    OS3Boot(pc),a4
  295.              moveq  #23,d0
  296.              bsr    _DOIO
  297.              rts
  298.  
  299.  
  300.  
  301.  
  302.              * Utility Boot V2.0 *
  303.  
  304.  
  305. _QUARTEXBOOT lea     QBoot(pc),a4
  306.              move.l  #255,d0
  307.              bsr     _DOIO
  308.              rts
  309.  
  310.  
  311.  
  312.  
  313.              * Standart DOS BootBlock *
  314.  
  315.  
  316. _DOSBOOT     lea     DOSBoot(pc),a4
  317.              moveq   #12,d0
  318.              bsr     _DOIO
  319.              rts
  320.  
  321.  
  322.  
  323.  
  324.              * Nicht bootfähiger BootBlock *
  325.  
  326.  
  327. _NOBOOT      lea     NoBoot(pc),a4
  328.              moveq   #0,d0
  329.              bsr     _DOIO
  330.              rts
  331.  
  332.  
  333.  
  334.  
  335.              * Devicekommando ausführen *
  336.  
  337.  
  338. _DOIO        move.l  DiskBuff(pc),a5
  339.  
  340.              MAKEBOOT:
  341.              move.l  (a4)+,(a5)+
  342.              dbra    d0,MAKEBOOT
  343.  
  344.              move.l  _SYSBase,a6
  345.              lea     DiskIO(pc),a1
  346.              move.w  #3,28(a1)
  347.              move.l  DiskBuff(pc),40(a1)
  348.              move.l  #0,44(a1)
  349.              move.l  #1024,36(a1)
  350.              jsr     _LVODoIO(a6)
  351.  
  352.              move.w  #4,28(a1)
  353.              jsr     _LVODoIO(a6)
  354.              rts
  355.  
  356.  
  357.  
  358.  
  359.              * Keine gültigen Parameter *
  360.  
  361.  
  362. _USAGE       move.l  _DOSBase(pc),a6
  363.              move.l  #Usage,d2
  364.              moveq   #82,d3
  365.              move.l  Handle(pc),d1
  366.              jsr     _LVOWrite(a6)
  367.              rts
  368.  
  369.  
  370.  
  371.  
  372.              * Fehler in Parameterübergabe *
  373.  
  374.  
  375. _FEHLER      bsr     _USAGE
  376.              bra     _CLOSELIB
  377.  
  378.  
  379.  
  380.  
  381.              * Device nicht vorhanden *
  382.  
  383.  
  384. _DEVFEHLER   move.l  _DOSBase(pc),a6
  385.              move.l  Handle(pc),d1
  386.              move.l  #Deverr,d2
  387.              moveq   #22,d3
  388.              jsr     _LVOWrite(a6)
  389.              bra     _CLOSELIB
  390.  
  391.  
  392.  
  393.  
  394.              * Datei konnte nicht geöffnet werden *
  395.  
  396.  
  397. _FILEFEHLER  move.l  _DOSBase(pc),a6
  398.              move.l  Handle(pc),d1
  399.              move.l  #Filerr,d2
  400.              moveq   #18,d3
  401.              jsr     _LVOWrite(a6)
  402.              rts
  403.  
  404.  
  405.  
  406.  
  407.              * Device schließen *
  408.  
  409.  
  410. _CLOSEDEV    move.l  _SYSBase,a6
  411.              lea     DiskIO(pc),a1
  412.              move.w  #9,28(a1)
  413.              move.l  #0,36(a1)
  414.              jsr     _LVODoIO(a6)
  415.              lea     DiskIO(pc),a1
  416.              jsr     _LVOCloseDevice(a6)
  417.              rts
  418.  
  419.  
  420.  
  421.  
  422.              * dos.library schließen *
  423.  
  424.  
  425. _CLOSELIB    move.l  _SYSBase,a6
  426.              move.l  _DOSBase(pc),a1
  427.              jsr     _LVOCloseLibrary(a6)
  428.              rts
  429.  
  430.  
  431.  
  432.  
  433.              * Speicherreservierung *
  434.  
  435.  
  436. _DOSBase  dc.l 0
  437. DiskBuff  dc.l 0
  438. Handle    dc.l 0
  439. Handledat dc.l 0
  440. Formatlen dc.l 0
  441. DiskReply ds.l 8
  442. DiskIO    ds.l 20
  443. Dosname   dc.b 'dos.library',0
  444. Device    dc.b 'trackdisk.device',0
  445.  
  446.  
  447. Usage   dc.b 'Usage: ',$9b,'33;40mDoBB',$9b,'0m [DFn:] [-F{file}] [-R{file}]'
  448.         dc.b ' [-W{file}] [-D] [-N] [-O] [-Q]',10
  449.  
  450. Deverr  dc.b 'Drive not available !',10
  451.  
  452. Filerr  dc.b 'Can`t open file !',10
  453.  
  454. DOSBoot dc.l $444F5300,$C0200F19,$370,$43FA0018,$4EAEFFA0,$4A80670A,$20402068
  455.         dc.l $167000,$4E7570FF,$60FA646F,$732E6C69,$62726172,$79000000
  456.  
  457. NoBoot  dc.l $444F5300
  458.  
  459. OS3Boot dc.l $444F5303,$E33D0E70,$370,$43FA003E,$70254EAE,$FDD84A80
  460.         dc.l $670C2240,$8E90006,$224EAE,$FE6243FA,$184EAE,$FFA04A80
  461.         dc.l $670A2040,$20680016,$70004E75,$70FF4E75,$646F732E,$6C696272
  462.         dc.l $61727900,$65787061,$6E73696F,$6E2E6C69,$62726172,$79000000
  463.  
  464. QBoot   dc.l $444F5300,$1C2238A9,$370,$48E7FF7E,$70026100,$22E7009
  465.         dc.l $42A90024,$6100023A,$41FA03CC,$22690014,$20A9003C,$22690038
  466.         dc.l $2F0943FA,$2B8303C,$4E20222E,$3E0481,$80004,$6B043340
  467.         dc.l $1E4AAE,$4E6704,$3340000A,$43FA02B6,$207A0394,$41E80034
  468.         dc.l $4A986604,$33400008,$4A986604,$33400012,$4A986604,$3340001C
  469.         dc.l $4AAE002A,$660C4AAE,$2E6606,$4AAE022A,$671A43FA,$3237020
  470.         dc.l $1340001A,$12C012BC,$4145FA,$2D424FC,$56495249,$43F90007
  471.         dc.l $80002449,$4299B3FC,$7F000,$66F62C57,$33FC01A0,$DFF096
  472.         dc.l $43FA01CE,$2D490032,$41F90007,$1000214A,$87001,$223C0000
  473.         dc.l $300243C,$100,$4EAEFE7A,$43F90007,$11004EAE,$FF3A43F9
  474.         dc.l $71100,$237C0007,$10000004,$70014EAE,$FEAA4BFA,$1C87800
  475.         dc.l $7632181D,$672E610E,$6830000,$1806106,$4BED001F,$60E843F9
  476.         dc.l $71100,$20032204,$4EAEFF10,$43F90007,$1100204D,$701F4EAE
  477.         dc.l $FFC44E75,$33FC8380,$DFF096,$283C000F,$F0002C78,$45384
  478.         dc.l $670000B8,$43FA025A,$C110041,$661243FA,$1663011,$2400F00
  479.         dc.l $6400100,$32805284,$4BF900BF,$E0010815,$66700,$8E102D
  480.         dc.l $C00422D,$C004600,$B03C00A0,$670000D4,$B03C00A2,$660A203C
  481.         dc.l $80000,$600000C8,$B03C00A4,$66164BF9,$FC00D0,$42AE0026
  482.         dc.l $4EAEFFE2,$41F80002,$4E704ED0,$B03C00A6,$6738B03C,$A86606
  483.         dc.l $4BFAFFEA,$60DEB03C,$AA6756,$B03C00AC,$66040855,$1B03C
  484.         dc.l $AE6612,$47FA020C,$32130841,$53681,$33C100DF,$F1DC6000
  485.         dc.l $FF52207A,$1F241E8,$3470FF,$20C020C0,$20806112,$43FA01E6
  486.         dc.l $4EAEFFA0,$20402068,$167000,$4E75205F,$588F4CDF,$7EFF2F08
  487.         dc.l $4E7561F2,$700541F9,$50000,$610C7003,$61087004,$61046000
  488.         dc.l $FDCC41F9,$30000,$23480028,$237C0000,$4000024,$42A9002C
  489.         dc.l $3340001C,$4EAEFE38,$4E75202E,$3E204E,$4BF900FC,$2800C65
  490.         dc.l $21FC66FA,$99CC4DF8,$6762640,$43F900DF,$F096203C,$7FFF7FFF
  491.         dc.l $22C022C0,$4EE8FFE2,$1002200,$1020001,$920020,$9400D8
  492.         dc.l $8E3000,$9030FF,$E00007,$E28870,$E40007,$E688A0
  493.         dc.l $1860AAA,$1840EEE,$1820777,$1800002,$FFFFFFFE,$223C3C3C
  494.         dc.l $3C3C3C20,$5554494C,$49545920,$424F4F54,$2056322E,$30203E3E
  495.         dc.l $3E3E3E3E,$35464153,$544D454D,$3A4F4646,$20202020,$20203120
  496.         dc.l $4D454720,$43484950,$3A4F4646,$2C202044,$46313A4F,$46462020
  497.         dc.l $20444632,$3A4F4646,$20202044,$46333A4F,$46462020,$43463120
  498.         dc.l $46415354,$4D454D20,$4F464620,$46322043,$4849502F,$46415354
  499.         dc.l $204F4646,$4C463320,$414C4C20,$4D454D20,$4F4E2020,$4634204B
  500.         dc.l $494C4C20,$44524956,$45532120,$55463520,$48415244,$20524553
  501.         dc.l $45542020,$46362049,$4E535441,$4C4C2042,$4F4F5420,$5E463720
  502.         dc.l $544F4747,$4C45204C,$45442020,$46382054,$4F472050,$414C2F4E
  503.         dc.l $54534320,$6C20204E,$4F205649,$52555320,$48415320,$4245454E
  504.         dc.l $20444554,$45435445,$44212020,$75424F4F,$54204259,$20204E2E
  505.         dc.l $4F2E4D2E,$412E4420,$204F4620,$51554152,$54455821,$0
  506.         dc.l $0,$646F732E,$6C696272,$61727900
  507.